package com.qf.controller;


import com.qf.service.BedService;
import com.qf.service.HotelService;
import com.qf.utils.QiNiuTools;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/hotel")
public class HotelController {
    @Autowired
    HotelService hotelService;
    @Autowired
    BedService bedService;

    @GetMapping("/findAll")
    public ResultMsg findAll(@RequestParam(required = false,defaultValue = "1")int start, @RequestParam(required = false,defaultValue = "10")int end){
        return hotelService.findAll(start,end);
    }

    @GetMapping("/citytohotel")//当前城市下的所有酒店
    public ResultMsg findCitytoHotel(Integer cityId){
       return hotelService.findCitytoHotel(cityId);
    }

    @GetMapping("/findhotelitem")//当前酒店所有房型信息
    public  ResultMsg findHotelItem(Integer hotelId){
       return bedService.findHotelItem(hotelId);
    }

    @GetMapping("/findonehotel")//当前酒店的信息
    public ResultMsg findOneHotel(Integer cityId,Integer hotelId){
        return hotelService.findOneHotel(cityId,hotelId);
    }
    @GetMapping("/findbeditem")//查询该酒店下的该房型的信息
    public ResultMsg findBedItem(Integer bedId,Integer hotelId){
        return bedService.findBedItem(bedId,hotelId);
    }


}
